package com.example.frenchconjugationquiz.data;

import common.Utility;

public class CSVDataAdapter
{	
	public static final int TOTAL_ENTRIES = 140 * 24;

	public static int addToDataSource(String[] line, ConjugationDataSource ds)
	{
		Utility.Log("Adding data batch");
		String infinitive = line[0];
		
		//Present
		ds.createConjugationModel(ds.Subjects[0], infinitive, ds.Tenses[0], line[5]);
		ds.createConjugationModel(ds.Subjects[1], infinitive, ds.Tenses[0], line[6]);
		ds.createConjugationModel(ds.Subjects[2], infinitive, ds.Tenses[0], line[7]);
		ds.createConjugationModel(ds.Subjects[3], infinitive, ds.Tenses[0], line[8]);
		ds.createConjugationModel(ds.Subjects[4], infinitive, ds.Tenses[0], line[9]);
		ds.createConjugationModel(ds.Subjects[5], infinitive, ds.Tenses[0], line[10]);
		
		//Imperfect
		ds.createConjugationModel(ds.Subjects[0], infinitive, ds.Tenses[1], line[11]);
		ds.createConjugationModel(ds.Subjects[1], infinitive, ds.Tenses[1], line[12]);
		ds.createConjugationModel(ds.Subjects[2], infinitive, ds.Tenses[1], line[13]);
		ds.createConjugationModel(ds.Subjects[3], infinitive, ds.Tenses[1], line[14]);
		ds.createConjugationModel(ds.Subjects[4], infinitive, ds.Tenses[1], line[15]);
		ds.createConjugationModel(ds.Subjects[5], infinitive, ds.Tenses[1], line[16]);

		//Future
		ds.createConjugationModel(ds.Subjects[0], infinitive, ds.Tenses[2], line[23]);
		ds.createConjugationModel(ds.Subjects[1], infinitive, ds.Tenses[2], line[24]);
		ds.createConjugationModel(ds.Subjects[2], infinitive, ds.Tenses[2], line[25]);
		ds.createConjugationModel(ds.Subjects[3], infinitive, ds.Tenses[2], line[26]);
		ds.createConjugationModel(ds.Subjects[4], infinitive, ds.Tenses[2], line[27]);
		ds.createConjugationModel(ds.Subjects[5], infinitive, ds.Tenses[2], line[28]);
		
		//Conditional
		ds.createConjugationModel(ds.Subjects[0], infinitive, ds.Tenses[3], line[29]);
		ds.createConjugationModel(ds.Subjects[1], infinitive, ds.Tenses[3], line[30]);
		ds.createConjugationModel(ds.Subjects[2], infinitive, ds.Tenses[3], line[31]);
		ds.createConjugationModel(ds.Subjects[3], infinitive, ds.Tenses[3], line[32]);
		ds.createConjugationModel(ds.Subjects[4], infinitive, ds.Tenses[3], line[33]);
		ds.createConjugationModel(ds.Subjects[5], infinitive, ds.Tenses[3], line[34]);
		
		int count = ds.getCount();
		Utility.Log("DataSource size : " + count);
		return count;
		
	}
}
